package routers

import (
	"github.com/gin-gonic/gin"
	ginSwagger "github.com/swaggo/gin-swagger"
	"github.com/swaggo/gin-swagger/swaggerFiles"
	"go-admin-api/controllers"
	_ "go-admin-api/docs"
	"go-admin-api/middlewares"
)

func InitRouter(r *gin.Engine) *gin.Engine{
	/*url := ginSwagger.URL("http://localhost:1060/swagger/doc.json")
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler,url))*/
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	r.Use(middlewares.CORSMiddleware())
	r.GET("/test", controllers.Register)
	r.GET("api/auth/info", middlewares.AuthMiddleware(), controllers.Info)
	return r
	//r.POST("/somePost", posting)
	//r.PUT("/somePut", putting)
	//r.DELETE("/someDelete", deleting)
	//r.PATCH("/somePatch", patching)
	//r.HEAD("/someHead", head)
	//r.OPTIONS("/someOptions", options)
}

//rg.GET("/docs/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
